# Makefile.in for kernel module

SHELL = /bin/sh
INSTALL = @INSTALL@
mkdir_p = mkdir -p
VERSION = @PACKAGE_VERSION@
OFED_CFLAGS = @OFED_CFLAGS@
KSYMVERS = @RDMA_SYMVERS@

NOSTDINC_FLAGS += @OFED_CFLAGS@


DISTFILES = Makefile.in configure.ac configure ../install-sh \
	libxio.h\
	xio_client.c xio_server.c

xiomoduledir = @kmoduledir@/extra/net/xio

xiomodule1 := xio_client_example.ko
xiomodule2 := xio_server_example.ko

all: all-@ENABLE_XIO_MODULE@
install: install-@ENABLE_XIO_MODULE@
uninstall: uninstall-@ENABLE_XIO_MODULE@

all-n:
install-n:
uninstall-n:

all-y: all-spec

install-y: all
	$(mkdir_p) $(DESTDIR)$(xiomoduledir)
	$(INSTALL) -m 644 $(xiomodule1) $(DESTDIR)$(xiomoduledir)/$(xiomodule1)
	$(INSTALL) -m 644 $(xiomodule2) $(DESTDIR)$(xiomoduledir)/$(xiomodule2)
	-/sbin/depmod -a

uninstall-y:
	rm -f $(DESTDIR)$(xiomoduledir)/$(xiomodule1)
	rm -f $(DESTDIR)$(xiomoduledir)/$(xiomodule2)
	-/sbin/depmod -a

clean:
	-rm -f $(xiomodule1) *.o .*.cmd *.mod.c *.ko *.s */*.o *.order *.symvers *.unsigned
	-rm -f $(xiomodule2) *.o .*.cmd *.mod.c *.ko *.s */*.o *.order *.symvers *.unsigned

distclean: clean
	rm -f Makefile configure config.status
	rm -f config.h config.log config.status config.cache
	rm -rf .tmp_versions autom4te.cache

maintainer-clean: distclean

distdir: $(DISTFILES)
	cp -p $(DISTFILES) $(distdir)


ccflags-y += -I$(SUBDIRS)/../../../include
obj-m := xio_server_example.o xio_client_example.o
xio_server_example-objs := xio_server.o
xio_client_example-objs := xio_client.o

all-spec:
	export NOSTDINC_FLAGS
	$(MAKE) -C @kernelsrc@ SUBDIRS=`pwd` KBUILD_EXTRA_SYMBOLS="$(KSYMVERS)" @KERNELMAKE_PARAMS@ modules
